<template>
	<view style="padding: 30rpx;">
		<view style="background-color: #fff;border-radius: 16rpx;">
			<u-cell-item title="工地名称" :value="czInfo.name | nullText" :arrow="false" hover-class="none"></u-cell-item>
			<u-cell-item title="工地类型" :value="czInfo.typeText | nullText" :arrow="false" hover-class="none"></u-cell-item>
			<u-cell-item title="有效期开始日期" :value="czInfo.startDate | nullText" :arrow="false" hover-class="none"></u-cell-item>
			<u-cell-item title="有效期结束日期" :value="czInfo.endDate | nullText" :arrow="false" hover-class="none"></u-cell-item>
			<u-cell-item title="是否报备建筑垃圾处理方案" :value="czInfo.isReportConstructionWaste==0?'否':'是'" :arrow="false" hover-class="none"></u-cell-item>
			<u-cell-item title="建设单位" :value="czInfo.constructionUnit | nullText" :arrow="false" hover-class="none"></u-cell-item>
			<u-cell-item title="施工单位" :value="czInfo.constructionCompany | nullText" :arrow="false" hover-class="none"></u-cell-item>
			<u-cell-item title="申报人名字" :value="czInfo.userName | nullText" :arrow="false" hover-class="none"></u-cell-item>
			<u-cell-item title="详细地址" :value="czInfo.address | nullText" :arrow="false" hover-class="none"></u-cell-item>
			<u-cell-item title="备注" :value="czInfo.remark | nullText" :arrow="false" hover-class="none"></u-cell-item>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				czInfo: ''
			}
		},
		filters:{
			nullText(v){
				if(v==null||v=='null'||!v){
					return v = ''
				}else{
					return v
				}
			}
		},
		onLoad(opt) {
			this.id = opt.id
			this.getData()
		},
		methods: {
			getData() {
				console.log("11")
				this.$u.get(`/construction/site/${this.id}`).then(res => {
					if (res.code == 200) {
						let s = res.data
						if (s.type == 1) {
							s.typeText = "房屋建筑工地"
						} else if (s.type == 2) {
							s.typeText = "拆迁土地"
						} else if (s.type == 3) {
							s.typeText = "收储工地"
						} else if (s.type == 4) {
							s.typeText = "绿化园林工地"
						} else if (s.type == 5) {
							s.typeText = "市政道路工地"
						} else if (s.type == 6) {
							s.typeText = "地铁市政工地"
						} else if (s.type == 7) {
							s.typeText = "企业建筑工地"
						} else if (s.type == 8) {
							s.typeText = "房屋装修"
						}
						this.czInfo = s
					}
				})
			}
		}
	}
</script>

<style>

</style>